import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from "path"
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],
  resolve:{
    alias:{
      "@":path.resolve(__dirname,"./src"),
    }
  },
  css: {
    preprocessorOptions: {
      scss: {
        // 全局引入变量// 给导入的路径最后加上 ;
        additionalData: `@import './src/assets/styles/variable.scss';`
      }
    }
  },
  // 代理配置
  server:{
    proxy:{
      '/api':{
        target:"http://localhost:80",
        changeOrigin:true,
        rewrite:(path)=>path.replace(/^\/api/,""),
      }
    }
  }

})
